#include "List.h"
#include "iostream"

using namespace std;

int main(int argc, char const *argv[])
{
	// 3572918
	int number[7] = {3,5,7,2,9,1,8};
	List *list = new List(10);

	for (int i = 0; i < 7; ++i)
	{
		int tmp = number[i];
		list->ListInsert(i, &tmp);
	}

	int tmp = 0;
	// get element
	list->GetElem(5, &tmp);
	cout<< "index at 5 is :" << tmp << endl;
	cout << "locate tmp at : " << list->LocateElem(&tmp) << endl;


	// prior  next
	int t = 0;
	list->PriorElem(&tmp, &t);
	cout << "prior element:" << t << endl;
	list->NextElem(&tmp, &t);
	cout << "next element:" << t << endl;

	
	list->ListDelete(5, &tmp);
	cout<<"delete:" <<tmp<<endl;

	if (!list->ListEmpty())
	{
		cout << "not empty" << endl;
	}

	list->ClearList();

	if (list->ListEmpty())
	{
		cout << "empty" << endl;
	}
	
	list->ListTraverse();

	delete list;

	return 0;
}